Unlike using Java, JavaScript or another script language embedded in your Web pages to extend HTML, a well written CGI will usually work regardless of the browser used by the reader. A CGI may be harder to develop, install and customize, though.
CGIs are often written in Perl (a script language popular on many Unix-based servers), AppleScript (on MacOS-based servers) or in C/C++.
Since the scripts are executed on the server, there are no easy way to display any examples when you view pages locally. They are often used for handling forms and for searching in databases, but there are of course many other uses for CGIs. You will need to set up your own server or talk with your Internet provider about the possibilities to use scripts on the server. There are many MacOS-based servers that are very easy to maintain and give enough performance to handle even very busy sites.
Here is a link to Yahoo's list of resources that contains scripts and CGIs: Computers and Internet:Internet:World Wide Web:CGI - Common Gateway Interface
If you need a custom CGI for a MacOS-based server written in C/C++, you are welcome to contact Optima System.